package com.googlecode.auctionx;

public class Restriction {
	private String name;
	private Object value;
	
	private Restriction (String name, Object value) {
		this.name = name;
		this.value = value;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Object getValue() {
		return value;
	}
	
	public static Restriction maxPrice(Long value) {
		return new Restriction("as_price_max", value.toString());
	}

	public static Restriction minPrice(Long value) {
		return new Restriction("as_price_min", value.toString());
	}

	public static Restriction category(Long id) {
		return new Restriction("as_categ_id", id.toString());
	}
	
	public static Restriction searchTitleDescription(boolean y) {
		return new Restriction("as_search_both", "Y");
	}

	public static Restriction only24hours() {
		return new Restriction("as_filtro_id", "24_HS");
	}

	public static Restriction onlyCertifiedSellers() {
		return new Restriction("as_filtro_id", "CERTIFIED");
	}

	public static Restriction onlyNewProducts() {
		return new Restriction("as_filtro_id", "NUEVO");
	}

	public static Restriction onlyUsedProducts() {
		return new Restriction("as_filtro_id", "USADO");
	}

	public static Restriction acceptPaymentType() {
		return new Restriction("as_filtro_id", "MPAGO");
	}

	public static Restriction location(String location) {
		return new Restriction("as_pcia_id", location);
	}

	public static Restriction auctionType(AuctionType auctionType) {
		return new Restriction("as_auct_type_id", auctionType);
	}

	public static Restriction buyNow() {
		return new Restriction("as_filtro_id", "PRECIO_FIJO");	
	}

	public static Restriction quantity(Long q) {
		return new Restriction("as_qshow", q.toString());
	}
	
}